s1 = int(input())
s2 = int(input())
s3 = int(input())
s4 = int(input())

print( s1*s4==s2*s3 or s1*s3==s2*s4 )

